﻿<MTreeview OpenAll
           Items="_data"
           ItemText="r => r.Name"
           ItemChildren="r => r.Children"
           ItemKey="r => r.Id">
</MTreeview>

@code{

    public class Data
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public List<Data> Children { get; set; }
    }

    private List<Data> _data = new List<Data>
    {
        new Data
        {
            Id = 1,
            Name = "Applications :",
            Children = new List<Data>
            {
                new Data
                {
                    Id = 2,
                    Name = "Calendar : app"
                },
                new Data
                {
                    Id = 3,
                    Name = "Chrome : app"
                },
                new Data
                {
                    Id = 4,
                    Name = "Webstorm : app"
                }
            }
        },
        new Data
        {
            Id = 5,
            Name = "Documents :",
            Children = new List<Data>
            {
                new Data
                {
                    Id = 6,
                    Name = "MASA Blazor :",
                    Children = new List<Data>
                    {
                        new Data
                        {
                            Id = 7,
                            Name = "src :",
                            Children = new List<Data>
                            {
                                new Data
                                {
                                    Id = 8,
                                    Name = "index : ts"
                                },
                                new Data
                                {
                                    Id = 9,
                                    Name = "bootstrap : ts"
                                }
                            }
                        }
                    }
                },
                new Data
                {
                    Id = 10,
                    Name = "material2 :",
                    Children = new List<Data>
                    {
                        new Data
                        {
                            Id = 11,
                            Name = "src :",
                            Children = new List<Data>
                            {
                                new Data
                                {
                                    Id = 12,
                                    Name = "MButton : cs"
                                },
                                new Data
                                {
                                    Id = 13,
                                    Name = "MCard : cs"
                                },
                                new Data
                                {
                                    Id = 14,
                                    Name = "MWindow : cs"
                                }
                            }
                        }
                    }
                }
            }
        },
        new Data
        {
            Id = 15,
            Name = "Downloads :",
            Children = new List<Data>
            {
                new Data
                {
                    Id = 16,
                    Name = "October : pdf"
                },
                new Data
                {
                    Id = 17,
                    Name = "November : pdf"
                },
                new Data
                {
                    Id = 18,
                    Name = "Tutorial : html"
                }
            }
        },
        new Data
        {
            Id = 19,
            Name = "Videos :",
            Children = new List<Data>
            {
                new Data
                {
                    Id = 20,
                    Name = "Tutorials :",
                    Children = new List<Data>
                    {
                        new Data
                        {
                            Id = 21,
                            Name = "Basic layouts : mp4"
                        },
                        new Data
                        {
                            Id = 22,
                            Name = "Advanced techniques : mp4"
                        },
                        new Data
                        {
                            Id = 23,
                            Name = "All about app : dir"
                        }
                    }
                },
                new Data
                {
                    Id = 24,
                    Name = "Intro : mov"
                },
                new Data
                {
                    Id = 25,
                    Name = "Conference introduction : avi"
                }
            }
        }
    };

}
